/**
 * Created by chenxiaokang on 2017/9/13.
 */
;(function () {
    window.ms = {
        set: set,
        get: get,
    };

    function set(key,val) {
        localStorage.setItem(key,JSON.stringify(val));
    }

    function get(key) {
        var json = localStorage.getItem(key);
        if(json) {
            return JSON.parse(json);
        }
    }
})();

ms.set('name','王花花');
console.log(ms.get('name'))